package org.guajava.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.guajava.domain.DictData;
import org.guajava.domain.SysRole;
import org.guajava.mapper.DictDataMapper;
import org.guajava.service.ISysDictService;

import java.util.List;

/**
 * ISysDictServiceImpl.java
 *
 * @Description:
 * @author: lishiming
 * @Date: 17:25 2019/1/8
 */

@Service
public class ISysDictServiceImpl implements ISysDictService {

    @Autowired
    private DictDataMapper dictDataMapper;

    @Override
    public List<SysRole> selectDictList(SysRole role) {
        return null;
    }

    /**
     * 根据字典类型查询字典数据
     *
     * @param dictType 字典类型
     * @return 字典数据集合信息
     */
    @Override
    public List<DictData> selectDictDataByType(String dictType)
    {
        return dictDataMapper.selectDictDataByType(dictType);
    }

    /**
     * 根据字典类型和字典键值查询字典数据信息
     *
     * @param dictType 字典类型
     * @param dictValue 字典键值
     * @return 字典标签
     */
    @Override
    public String selectDictLabel(String dictType, String dictValue)
    {
        return dictDataMapper.selectDictLabel(dictType, dictValue);
    }

}
